#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int countGoodStrings(int low, int high, int zero, int one) {
        vector<int> dp(high + 1);
        dp[0] = 1;
        int mod = 1e9 + 7;
        for (int i = 1; i <= high; i++) {
            int z = (i - zero >= 0 ? dp[i - zero] : 0);
            int o = (i - one >= 0 ? dp[i - one] : 0);
            dp[i] = (z + o) % mod;
        }
        int sum = 0;
        for (int i = low; i <= high; i++) sum = (sum + dp[i]) % mod;
        return sum;
    }
};